]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tests: Fix environment
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 3 Oct 2010 02:16:07 +0000 (04:16 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 4 Oct 2010 22:05:57 +0000 (00:05 +0200)
Environment.init() uses Shell.Global, which is not accessible outside
the mutter process; allowing to run the function when window.global is
undefined fixes the environment for tests.

https://bugzilla.gnome.org/show_bug.cgi?id=631091

js/ui/environment.js

index 6bab8300e4d5c8a140dca61f10ed8365ad2d2139..82ecea148325728894ed322a097627fff7e8c2b7 100644 (file)
@@ -83,6 +83,9 @@ function init() {
         return St.describe_actor(this);
     };
 
+    if (window.global === undefined) // test environment
+        return;
+
     _blockMethod('Clutter.Event.get_state', 'Shell.get_event_state',
                  'gjs\'s handling of Clutter.ModifierType is broken. See bug 597292.');
     _blockMethod('Gdk.Display.get_device_state', 'global.get_pointer',